package com.huanxing.cloud.mall.common.feign;

import com.huanxing.cloud.common.core.constant.SecurityConstants;
import com.huanxing.cloud.common.core.constant.ServiceNameConstants;
import com.huanxing.cloud.common.core.entity.Result;
import com.huanxing.cloud.common.feign.config.FeignInterceptor;
import com.huanxing.cloud.pay.common.dto.AliPayRequestDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * 支付宝支付feign接口
 *
 * @author lijx
 * @date 2022/6/10
 */
@FeignClient(contextId = "feignAliPayService", value = ServiceNameConstants.PAY_API_SERVICE,
		configuration = FeignInterceptor.class)
public interface FeignAliPayService {

	/**
	 * 调用统一下单接口
	 * @param aliPayRequestDTO
	 * @author lijx
	 * @date 2022/3/14 16:08
	 * @return: com.huanxing.cloud.common.core.entity.Result
	 */
	@PostMapping("/alipay/create/order")
	Result createOrder(@RequestBody AliPayRequestDTO aliPayRequestDTO,
			@RequestHeader(SecurityConstants.SOURCE) String source);

}
